#!/bin/sh

if [ -f /proc/stb/fp/rtc ] ; then
	LIMIT_TIME=1514808000 #01.01.2018
	RTC_TIME=$( cat /proc/stb/fp/rtc )
	SYSTEM_TIME=$(date +%s)
	if [ "$RTC_TIME" -gt "$LIMIT_TIME" ]; then
		if [ "$SYSTEM_TIME" -lt "$LIMIT_TIME" ]; then
			date -s @$RTC_TIME
			echo "set rtc time ..."
		fi
	fi
fi

exit 0
